package com.scwatch.ext.domain;

import com.scwatch.core.domain.Site;
import com.scwatch.core.domain.User;

import javax.persistence.*;
import java.util.Date;

/**
 * @author mafei
 * @Title: ClickRate
 * @ProjectName SCGC_CMS
 * @Description: TODO
 * @date 2018/9/2915:40
 */
@Entity
@Table(name = "cms_share_click")
public class ClickRate {
    private Integer id;
    private Integer type;//
    private Site site;
    private Integer isOpen;
    private Date createTime;
    private User user;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "site_id", nullable = false)
    public Site getSite() {
        return site;
    }

    public void setSite(Site site) {
        this.site = site;
    }
    @Id
    @Column(name = "id", unique = true, nullable = false)
    @TableGenerator(name = "tg_cms_share_click", pkColumnValue = "cms_share_click", initialValue = 1, allocationSize = 10)
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "tg_cms_share_click")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    @Basic
    @Column(name = "create_time", nullable = true)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "type", nullable = true)
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Basic
    @Column(name = "is_open", nullable = true)
    public Integer getIsOpen() {
        return isOpen;
    }

    public void setIsOpen(Integer isOpen) {
        this.isOpen = isOpen;
    }
}
